package cn.wuxing.mediation.businessplatform.domain.enums;

/**
 * @description: <描述>
 * @date: 2024/9/19 14:54
 * @author: yang
 * @version: 1.0
 */

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OperatingTypeEnum {

    // 1.案件登记 2.案件分派 3.案件受理 9.案件结案

    REGISTER(1, "案件登记"),
    ASSIGN(2, "案件分派"),
    ACCEPT(3, "现场调解"),
    MEDIATE(4, "现场调解"),
    CHANG_WINDOW(5, "转窗口"),
    CHANG_WINDOW_CONFIRM(6, "转窗口确认"),
    RECALL(7, "召回"),

    RECALL_CONFIRM(8, "分派调解员"),

    CLOSE(9, "案件结案");

    private final Integer code;
    private final String desc;

    public static String getDesc(Integer code) {
        for (OperatingTypeEnum operatingTypeEnum : OperatingTypeEnum.values()) {
            if (operatingTypeEnum.getCode().equals(code)) {
                return operatingTypeEnum.getDesc();
            }
        }
        return null;
    }

    public static List<Integer> getHanderType(){
        return Stream.of(ACCEPT.getCode(), MEDIATE.getCode()).collect(Collectors.toList());
    }
}
